<%@ Control Language="VB" AutoEventWireup="false" CodeFile="ctlGestionarTitular.ascx.vb" Inherits="Pages_Controls_ctlGestionarTitular" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v10.1, Version=10.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v10.1, Version=10.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
        <table>
            <tr>
                <td style="width: 142px; height: 81px">
                    <dx:ASPxRadioButtonList ID="optTipo" runat="server" CssFilePath="~/App_Themes/Youthful/{0}/styles.css"
                        CssPostfix="Youthful" Font-Bold="True" SelectedIndex="0" SpriteCssFilePath="~/App_Themes/Youthful/{0}/sprite.css"
                        TextSpacing="4px" ValueType="System.Int32">
                        <Items>
                            <dx:ListEditItem Selected="True" Text="Por DNI" Value="1" />
                            <dx:ListEditItem Text="Por Codigo" Value="2" />
                        </Items>
                    </dx:ASPxRadioButtonList>
                </td>
                <td style="height: 81px">
                    <dx:ASPxTextBox ID="txtCodigoPersona" runat="server" CssFilePath="~/App_Themes/Youthful/{0}/styles.css"
                        CssPostfix="Youthful" SpriteCssFilePath="~/App_Themes/Youthful/{0}/sprite.css"
                        Width="170px">
                        <ValidationSettings>
                            <ErrorFrameStyle ImageSpacing="4px">
                                <ErrorTextPaddings PaddingLeft="4px" />
                            </ErrorFrameStyle>
                            <RequiredField ErrorText="Ingrese el dato" IsRequired="True" />
                        </ValidationSettings>
                    </dx:ASPxTextBox>
                </td>
                <td style="height: 81px">
                    <dx:ASPxButton ID="btnSeleccionar" runat="server" CausesValidation="False"
                        CssFilePath="~/App_Themes/Youthful/{0}/styles.css" CssPostfix="Youthful" Font-Bold="True"
                        Height="12px" OnClick="btnSeleccionar_Click" SpriteCssFilePath="~/App_Themes/Youthful/{0}/sprite.css"
                        Text="Cargar" Width="74px" AutoPostBack="False">
                        <Image Url="~/Images/icons/page_copy.png">
                        </Image>
                    </dx:ASPxButton>
                </td>
                <td style="width: 7px; height: 81px">
                    &nbsp;</td>
            </tr>
            <tr>
                <td colspan="3" style="height: 81px">
                    <dx:ASPxLabel ID="lblMensaje" runat="server" ClientVisible="False" ForeColor="#CC0000"
                        Visible="False" Width="689px">
                    </dx:ASPxLabel>
                </td>
                <td style="width: 7px; height: 81px">
                </td>
            </tr>
        </table>
        <br />
        <table style="width: 151px">
            <tr>
                <td style="height: 21px" colspan="3">
                    <dx:ASPxTextBox ID="txtTitularID" runat="server" ClientVisible="False" CssFilePath="~/App_Themes/Youthful/{0}/styles.css"
                        CssPostfix="Youthful" SpriteCssFilePath="~/App_Themes/Youthful/{0}/sprite.css"
                        Text="0" Visible="False" Width="170px">
                        <ValidationSettings>
                            <ErrorFrameStyle ImageSpacing="4px">
                                <ErrorTextPaddings PaddingLeft="4px" />
                            </ErrorFrameStyle>
                        </ValidationSettings>
                    </dx:ASPxTextBox>
                </td>
            </tr>
            <tr>
                <td style="height: 21px" colspan="3">
                    <dx:aspxgridview id="ASPxGridView1" runat="server" cssfilepath="~/App_Themes/Youthful/{0}/styles.css"
                        csspostfix="Youthful" datasourceid="ObjectDataSourceTitular" width="655px" AutoGenerateColumns="False" KeyFieldName="TB_SOC_ESI_Titular_ID">
<Styles CssPostfix="Youthful" CssFilePath="~/App_Themes/Youthful/{0}/styles.css">
<Header SortingImageSpacing="5px" ImageSpacing="5px"></Header>

<LoadingPanel ImageSpacing="10px"></LoadingPanel>
</Styles>

<SettingsLoadingPanel Text=""></SettingsLoadingPanel>

<ImagesFilterControl>
<LoadingPanel Url="~/App_Themes/Youthful/Editors/Loading.gif"></LoadingPanel>
</ImagesFilterControl>

<Images SpriteCssFilePath="~/App_Themes/Youthful/{0}/sprite.css">
<LoadingPanelOnStatusBar Url="~/App_Themes/Youthful/GridView/gvLoadingOnStatusBar.gif"></LoadingPanelOnStatusBar>

<LoadingPanel Url="~/App_Themes/Youthful/GridView/Loading.gif"></LoadingPanel>
</Images>

<StylesEditors>
<CalendarHeader Spacing="8px"></CalendarHeader>

<ProgressBar Height="25px"></ProgressBar>
</StylesEditors>
                        <Columns>
                            <dx:GridViewDataTextColumn FieldName="TB_SOC_ESI_Titular_ID" ReadOnly="True" Visible="False"
                                VisibleIndex="0">
                                <EditFormSettings Visible="False" />
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn Caption="Nombres" FieldName="nombres" VisibleIndex="0">
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn Caption="Apellido Paterno" FieldName="apellidoPaterno"
                                VisibleIndex="1">
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn Caption="Apellido Materno" FieldName="apellidoMaterno"
                                VisibleIndex="2">
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn Caption="Sexo" FieldName="sexo" VisibleIndex="3">
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn Caption="Estado Civil" FieldName="estadoCivil" VisibleIndex="4">
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataDateColumn Caption="Fecha Nacimiento" FieldName="fechaNacimiento"
                                VisibleIndex="5">
                            </dx:GridViewDataDateColumn>
                                <dx:GridViewDataHyperLinkColumn Caption="Editar" FieldName="TB_SOC_ESI_Titular_ID" ReadOnly="True"
                    VisibleIndex="9">
                    <PropertiesHyperLinkEdit ImageUrl="~/Images/icons/page_white_edit.png" NavigateUrlFormatString="~/Pages/frmFichaTitular.aspx?KEY={0}">
                    </PropertiesHyperLinkEdit>
                    <EditFormSettings Visible="False" />
                    <Settings AllowAutoFilter="False" />
                </dx:GridViewDataHyperLinkColumn>
                        </Columns>
</dx:aspxgridview>
                </td>
            </tr>
            <tr>
                <td colspan="3" style="height: 213px">
                    <asp:ImageButton ID="imgNuevo" runat="server" ImageUrl="~/Images/icons/page_2.png"
                        OnClick="imgNuevo_Click" ToolTip="Nuevo" />
                        <dx:ASPxGridView ID="gridFamiliares" runat="server"
                            AutoGenerateColumns="False" Caption="Lista de Familiares" CssFilePath="~/App_Themes/Youthful/{0}/styles.css"
                            CssPostfix="Youthful" DataSourceID="ObjectDataSourceFamiliares" KeyFieldName="TB_SOC_ESI_Familiar_ID"
                            Width="80%">
                            <Styles CssFilePath="~/App_Themes/Youthful/{0}/styles.css" CssPostfix="Youthful">
                                <Header ImageSpacing="5px" SortingImageSpacing="5px">
                                </Header>
                                <LoadingPanel ImageSpacing="10px">
                                </LoadingPanel>
                            </Styles>
                            <SettingsLoadingPanel Text="" />
                            <ImagesFilterControl>
                                <LoadingPanel Url="~/App_Themes/Youthful/Editors/Loading.gif">
                                </LoadingPanel>
                            </ImagesFilterControl>
                            <Images SpriteCssFilePath="~/App_Themes/Youthful/{0}/sprite.css">
                                <LoadingPanelOnStatusBar Url="~/App_Themes/Youthful/GridView/gvLoadingOnStatusBar.gif">
                                </LoadingPanelOnStatusBar>
                                <LoadingPanel Url="~/App_Themes/Youthful/GridView/Loading.gif">
                                </LoadingPanel>
                            </Images>
                            <Columns>
                <dx:GridViewDataDateColumn FieldName="fecha_inscripcion" Visible="False" VisibleIndex="0">
                </dx:GridViewDataDateColumn>
                <dx:GridViewDataTextColumn FieldName="TB_SOC_ESI_Parentesco_ID" Visible="False" VisibleIndex="0">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn FieldName="TB_SOC_ESI_Titular_ID" Visible="False" VisibleIndex="1">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn FieldName="TB_SOC_ESI_Persona_ID" Visible="False" VisibleIndex="2">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn FieldName="codParentesco" Visible="False" VisibleIndex="3">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn Caption="Parentesco" FieldName="descripcion" VisibleIndex="0">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn Caption="Codigo" FieldName="codPersona" VisibleIndex="1">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn Caption="Nombre" FieldName="nombres" VisibleIndex="2">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn Caption="Apellido Paterno" FieldName="apellidoPaterno"
                    VisibleIndex="3">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn Caption="Apellido Materno" FieldName="apellidoMaterno"
                    VisibleIndex="4">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataDateColumn Caption="Fecha Nacimiento" FieldName="fechaNacimiento"
                    VisibleIndex="5">
                </dx:GridViewDataDateColumn>
                <dx:GridViewDataTextColumn Caption="Tipo Documento" FieldName="tipoDocumento" VisibleIndex="6">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn Caption="N&#250;mero" FieldName="nroDocumento" VisibleIndex="7">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn Caption="Sexo" FieldName="sexo" VisibleIndex="8">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn Caption="Estado" FieldName="estadoPersona" Visible="False"
                    VisibleIndex="9">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn Caption="Ingreso Mensual" FieldName="IngresoMensual" Visible="False"
                    VisibleIndex="9">
                </dx:GridViewDataTextColumn>
                
                <dx:GridViewDataHyperLinkColumn Caption="Editar" FieldName="TB_SOC_ESI_Familiar_ID" ReadOnly="True"
                    VisibleIndex="9">
                    <PropertiesHyperLinkEdit ImageUrl="~/Images/icons/page_white_edit.png" NavigateUrlFormatString="~/Pages/frmFichaFamiliar.aspx?KEY={0}&amp;F=T">
                    </PropertiesHyperLinkEdit>
                    <EditFormSettings Visible="False" />
                    <Settings AllowAutoFilter="False" />
                </dx:GridViewDataHyperLinkColumn>
            </Columns>
                            <Settings ShowFilterRow="True" />
                            <StylesEditors>
                                <CalendarHeader Spacing="8px">
                                </CalendarHeader>
                                <ProgressBar Height="25px">
                                </ProgressBar>
                            </StylesEditors>
                        </dx:ASPxGridView>
                </td>
            </tr>
        </table>
        <asp:ObjectDataSource ID="ObjectDataSourceTitular" runat="server" SelectMethod="GetData"
            TypeName="FichaIncripcionTableAdapters.sp_TB_SOC_ESI_Titular_SelectByCodTitularTableAdapter" OldValuesParameterFormatString="original_{0}">
            <SelectParameters>
                <asp:ControlParameter ControlID="txtTitularID" DefaultValue="0" Name="TitularID"
                    PropertyName="Text" Type="Int32" />
            </SelectParameters>
        </asp:ObjectDataSource>
        <br />
        <asp:ObjectDataSource ID="ObjectDataSourceFamiliares" runat="server" OldValuesParameterFormatString="original_{0}"
            SelectMethod="GetData" TypeName="FichaIncripcionTableAdapters.sp_TB_SOC_ESI_Familiar_SelectAllTableAdapter">
            <SelectParameters>
                <asp:ControlParameter ControlID="txtTitularID" DefaultValue="0" Name="TB_SOC_ESI_Titular_ID"
                    PropertyName="Text" Type="Int32" />
            </SelectParameters>
        </asp:ObjectDataSource>
    </ContentTemplate>
</asp:UpdatePanel>
